﻿using Common.Data.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Warranty.Configuration;
using Warranty.Model.Model;

namespace Warranty.DBConfig
{
    public class OrderShipHistConfiguration : DBConfig<OrderShipHist>
    {
        public OrderShipHistConfiguration() : base(SystemConfiguration.ConnectionString, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(k => new { k.ShiptoCode, k.OrderNo, k.LineNo, k.ReleaseQuantity, k.RequestArrivalDate, k.Model, k.Suffix });

            Property(c => c.InvOrg).HasMaxLength(3).IsRequired();
            Property(c => c.OrderNo).HasMaxLength(12).IsRequired();
            Property(c => c.UniqueId).IsRequired();
        }
    }
}
